Optimal. Leaf size=32 \[ -\frac {i (a+i a \tan (c+d x))^{1+n}}{a d (1+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3568, 32}
\begin {gather*} -\frac {i (a+i a \tan (c+d x))^{n+1}}{a d (n+1)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 32
Rule 3568
Rubi steps
\begin {align*} \int \sec ^2(c+d x) (a+i a \tan (c+d x))^n \, dx &=-\frac {i \text {Subst}\left (\int (a+x)^n \, dx,x,i a \tan (c+d x)\right )}{a d}\\ &=-\frac {i (a+i a \tan (c+d x))^{1+n}}{a d (1+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(111\) vs. \(2(32)=64\).
time = 13.20, size = 111, normalized size = 3.47 \begin {gather*} -\frac {i 2^{1+n} e^{i (c+d x)} \left (e^{i d x}\right )^n \left (\frac {e^{i (c+d x)}}{1+e^{2 i (c+d x)}}\right )^{1+n} \sec ^{-n}(c+d x) (\cos (d x)+i \sin (d x))^{-n} (a+i a \tan (c+d x))^n}{d (1+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 31, normalized size = 0.97
method | result | size |
derivativedivides | \(-\frac {i \left (a +i a \tan \left (d x +c \right )\right )^{1+n}}{a d \left (1+n \right )}\) | \(31\) |
default | \(-\frac {i \left (a +i a \tan \left (d x +c \right )\right )^{1+n}}{a d \left (1+n \right )}\) | \(31\) |
risch | \(-\frac {2 i {\mathrm e}^{\frac {i \pi \,\mathrm {csgn}\left (\frac {i {\mathrm e}^{2 i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) \mathrm {csgn}\left (\frac {i a \,{\mathrm e}^{2 i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{2} n}{2}-\frac {i \pi \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{3} n}{2}+2 i d x -\frac {i \pi \mathrm {csgn}\left (i {\mathrm e}^{2 i \left (d x +c \right )}\right )^{3} n}{2}+\frac {i \pi \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{2} \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) n}{2}+i \pi \mathrm {csgn}\left (i {\mathrm e}^{2 i \left (d x +c \right )}\right )^{2} \mathrm {csgn}\left (i {\mathrm e}^{i \left (d x +c \right )}\right ) n -\frac {i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{2 i \left (d x +c \right )}\right ) \mathrm {csgn}\left (i {\mathrm e}^{i \left (d x +c \right )}\right )^{2} n}{2}-\frac {i \pi \mathrm {csgn}\left (\frac {i a \,{\mathrm e}^{2 i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{3} n}{2}+2 i c +\frac {i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{2 i \left (d x +c \right )}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{2} n}{2}-\frac {i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{2 i \left (d x +c \right )}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{2 i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) \mathrm {csgn}\left (\frac {i}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) n}{2}-\frac {i \pi \,\mathrm {csgn}\left (\frac {i {\mathrm e}^{2 i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) \mathrm {csgn}\left (\frac {i a \,{\mathrm e}^{2 i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right ) \mathrm {csgn}\left (i a \right ) n}{2}+\frac {i \pi \mathrm {csgn}\left (\frac {i a \,{\mathrm e}^{2 i \left (d x +c \right )}}{{\mathrm e}^{2 i \left (d x +c \right )}+1}\right )^{2} \mathrm {csgn}\left (i a \right ) n}{2}+2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}\right ) n -\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) n +n \ln \left (2\right )+n \ln \left (a \right )}}{\left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) d \left (1+n \right )}\) | \(544\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 28, normalized size = 0.88 \begin {gather*} -\frac {i \, {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n + 1}}{a d {\left (n + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 60 vs. \(2 (28) = 56\).
time = 0.38, size = 60, normalized size = 1.88 \begin {gather*} -\frac {2 i \, \left (\frac {2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n} e^{\left (2 i \, d x + 2 i \, c\right )}}{d n + {\left (d n + d\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{n} \sec ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 62 vs. \(2 (28) = 56\).
time = 0.73, size = 62, normalized size = 1.94 \begin {gather*} -\frac {i \, \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 i \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1}\right )^{n + 1}}{a d {\left (n + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.42, size = 104, normalized size = 3.25 \begin {gather*} \frac {2\,\left (\cos \left (2\,d\,x\right )+\sin \left (2\,d\,x\right )\,1{}\mathrm {i}\right )\,\left (\cos \left (2\,c\right )+\sin \left (2\,c\right )\,1{}\mathrm {i}\right )\,{\left (\frac {a\,\left (\cos \left (2\,c+2\,d\,x\right )+1+\sin \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,c+2\,d\,x\right )+1}\right )}^n}{d\,\left (n+1\right )\,\left (\cos \left (2\,c+2\,d\,x\right )\,1{}\mathrm {i}-\sin \left (2\,c+2\,d\,x\right )+1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________